package appConfig

import (
	"github.com/spf13/viper"
	"log"
)

type AppConfig struct {
	Mysql
	Redis
	RealNameAuth
}
type Mysql struct {
	User     string
	Password string
	Host     string
	Port     int
	Database string
}

type Redis struct {
	Adds     string
	Password string
}

type RealNameAuth struct {
	SecretId  string
	SecretKey string
}

var ConfigData AppConfig

func Init() {
	viper.SetConfigFile("appConfig/config.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&ConfigData)
	log.Println(ConfigData)
}
